using System;
using System.Windows.Forms;
namespace com.haopintui.util
{
	public class FormUtil
	{
		public static void set_formWindowState(CmsForm cmsForm, FormWindowState formWindowState)
		{
			try
			{
				if (cmsForm.InvokeRequired)
				{
					formWindowState method = new formWindowState(FormUtil.set_formWindowState);
					cmsForm.BeginInvoke(method, new object[]
					{
						cmsForm,
						formWindowState
					});
				}
				else
				{
					cmsForm.WindowState = formWindowState;
					if (formWindowState == FormWindowState.Normal)
					{
						cmsForm.Activate();
					}
				}
			}
			catch (Exception ex)
			{
				LogUtil.log_str(cmsForm, "[SetFormState]出错，" + ex.ToString());
			}
		}
	}
}
